<template>
  <div class="right">
      <Breadcrumb
      :params1="'权限管理'"
      :params2="'权限列表'"
    ></Breadcrumb>
    <el-card class="box-card" >
    <el-table
    :data="list"
    border
    style="width: 100%">
     <el-table-column
      type=index
      label="#"
      width="80">
    </el-table-column>
    <el-table-column
      prop="authName"
      label="权限名称"
      width="auto">
    </el-table-column>
    <el-table-column
      prop="path"
      label="路径"
      width="auto">
    </el-table-column>
    <el-table-column
     
      label="权限等级"
       width="auto">
        <template slot-scope="scope">
          <div>
             <el-tag v-if="scope.row.level == 0">一级</el-tag>
             <el-tag type="success" v-else-if="scope.row.level == 1">二级</el-tag>
             <el-tag type="warning" v-else>三级</el-tag>
          </div>
        </template>
    
    </el-table-column>
  </el-table>
    </el-card>
  </div>
</template>

<script>

import { rightlist_api } from '@/api/index'
export default {
  data() {
    return {
      list : []
    }
  },
  methods: {
    async  getRightList(){
      var res = await rightlist_api()
      // console.log(res);
      this.list = res.data.data
    }
  },

  mounted() {
    this.getRightList()
  },
}
</script>

<style scoped lang='less'>
.box-card{
  width: 95%;
  margin: 0 auto;
  }
</style>